﻿using SimpleIpc;
using SimpleIpcServer.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleIpcServer
{
    class Program
    {
        static void Main(string[] args)
        {
            IRemoteChannel channel = null;
            try
            {
                channel = RemoteChannelFactory.CreateIpcChannel("ipcServer", "ipcServer");
                channel.RegisterChannel();
                channel.RegisterWellKnownService<ServiceImpl>("service");
                Console.WriteLine("ipcServer started.");
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception: {0}", ex.Message);
            }
            var line = string.Empty;
            while (!(line = Console.ReadLine()).Equals("quit"))
            {
                Console.WriteLine(line);
            }
        }
    }
}
